home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
VISUALBA
/
VB_SMPL.ZIP
/
BNDREAD.EXE
/
READONLY.FRM
< prev
next >
Wrap
Text File
|
1994-04-06
|
4KB
|
137 lines
VERSION 2.00
Begin Form Form1
Caption = "Data Control with Bound ReadOnly Text boxes"
ClientHeight = 3825
ClientLeft = 1095
ClientTop = 1485
ClientWidth = 6120
Height = 4230
Left = 1035
LinkTopic = "Form1"
ScaleHeight = 3825
ScaleWidth = 6120
Top = 1140
Width = 6240
Begin CommandButton Command2
Caption = "Push to make Read/Write"
Height = 495
Left = 3240
TabIndex = 1
Top = 2280
Width = 2415
End
Begin CommandButton Command1
Caption = "Push to make ReadOnly"
Height = 495
Left = 600
TabIndex = 0
Top = 2280
Width = 2295
End
Begin TextBox Text2
DataField = "Author"
DataSource = "Data1"
Height = 375
Left = 2040
TabIndex = 3
Top = 1440
Width = 2415
End
Begin TextBox Text1
DataField = "Au_ID"
DataSource = "Data1"
Height = 375
Left = 2640
TabIndex = 2
Top = 600
Width = 1815
End
Begin Data Data1
Caption = "Data1"
Connect = ""
DatabaseName = "C:\vb\BIBLIO.MDB"
Exclusive = 0 'False
Height = 270
Left = 2040
Options = 0
ReadOnly = 0 'False
RecordSource = "Authors"
Top = 3240
Width = 2415
End
Begin Label Label3
Alignment = 2 'Center
AutoSize = -1 'True
Caption = "Default is set to Read/Write"
FontBold = -1 'True
FontItalic = -1 'True
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 240
Left = 1635
TabIndex = 6
Top = 0
Width = 2985
End
Begin Label Label2
Caption = "Author Name:"
Height = 255
Left = 600
TabIndex = 5
Top = 1440
Width = 1335
End
Begin Label Label1
Caption = "Author Identification:"
Height = 255
Left = 600
TabIndex = 4
Top = 600
Width = 1815
End
End
Option Explicit
Dim readonly_flag%
Sub check_if_readonly (keyascii As Integer)
If keyascii > 0 And readonly_flag% = 1 Then '** if they press any key and readonly_flag% = 1 then
keyascii = 0 '** turn keystroke off
End If
End Sub
Sub Command1_Click ()
data1.ReadOnly = True '*** set the incoming data to readonly
readonly_flag% = 1 '*** set readonly_flag% to 1 to makde text boxes readonly
label3.Caption = "ReadOnly record"
End Sub
Sub Command2_Click ()
data1.ReadOnly = False '*** set the incoming data to read/write
readonly_flag% = 0 '*** set readonly_flag% to 0 to make text boxes read/write
label3.Caption = "Read/Write record"
End Sub
Sub Form_Load ()
readonly_flag% = 0 '** set default to read/write
End Sub
Sub Text1_KeyPress (keyascii As Integer)
Call check_if_readonly(keyascii)
End Sub
Sub Text2_KeyPress (keyascii As Integer)
Call check_if_readonly(keyascii)
End Sub